﻿using System;

namespace diantou.web.enterprise
{
    /// <summary>
    /// 邮件模版
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPage = false, IsPool = true)]
    partial class mailEdit : examPermissionView<mailEdit>
    {
        /// <summary>
        /// 考试
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private diantou.examDataAccess.exam exam;
        /// <summary>
        /// 邮件模版
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private diantou.examDataAccess.enterpriseMail mail;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mailId"></param>
        /// <returns></returns>
        private bool loadView(int mailId, int examId, bool sms)
        {
            if (mailId == 0)
            {
                mail = sms ? diantou.examDataAccess.enterpriseMail.NullSms : diantou.examDataAccess.enterpriseMail.NullMail;
                return true;
            }
            mail = diantou.examDataAccess.tcpCall.enterpriseMail.get(mailId, currentUserId);
            if (mail != null)
            {
                if (examId == 0) exam = diantou.examDataAccess.exam.NullExam;
                else exam = diantou.examDataAccess.clientCache.GetExam(examId, currentUser, false);
                return true;
            }
            AjaxResponse(webConfig.NotFound404);
            return false;
        }
    }
}
